package tds.model20.version1;
/**
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName Client
 * @Description TODO（这里用一句话描述这个类的作用)
 * @author tds
 * @Date 2020/2/5 17:36
 * @version 1.0.0
 */
public class Client {
    public static void main(String[] args) {
        Component c1 = new Composite("枝节点");
        Component leaf = new Leaf("叶子节点");
        Component root = new Composite("根节点");
        root.add(c1);
        c1.add(leaf);

        System.out.println("初始化各个节点：");
        c1.display();
        root.display();

        System.out.println("删除叶子节点后：");
        c1.remove(leaf);
        root.display();
    }
}
